//package Jgit;
//
//import org.eclipse.jgit.api.CheckoutCommand;
//import org.eclipse.jgit.api.CherryPickCommand;
//import org.eclipse.jgit.api.Git;
//import org.eclipse.jgit.lib.ObjectId;
//import org.eclipse.jgit.lib.Repository;
//import org.eclipse.jgit.merge.ContentMergeStrategy;
//import org.eclipse.jgit.revwalk.RevCommit;
//import org.eclipse.jgit.revwalk.filter.RevFilter;
//import org.eclipse.jgit.storage.file.FileRepositoryBuilder;
//
//import java.io.File;
//import java.util.ArrayList;
//import java.util.List;
//
//public class Main {
//    public static void main(String[] args) throws Exception {
//        Repository repository = new FileRepositoryBuilder().setGitDir(new File("D:\\Work\\GoWorkSpace\\shipping-crm\\.git")).build();
//        Git git = new Git(repository);
////        List<Ref> refs = git.branchList().call();
//        CheckoutCommand checkout = git.checkout();
//        checkout.setName("develop").call();
//
//
//        List<ObjectId> ids = new ArrayList<>();
//        Iterable<RevCommit> revCommits = git.log().setRevFilter(RevFilter.NO_MERGES).call();
//        for (RevCommit c : revCommits) {
//            if (c.getFullMessage().contains("cherry picked")) {
//                continue;
//            }
//            System.out.println(c.getCommitTime());
//            System.out.println(c.getName());
//            System.out.println(c.getFullMessage());
////            if (c.getName().equals("db5923553065703f0c225da0da559f7a577817a8")) {
//            ids.add(c.getId());
////            }
//        }
//
//        checkout = git.checkout();
//        checkout.setName("QA").call();
//
//        CherryPickCommand cherryPickCommand = git.cherryPick();
//        cherryPickCommand.setContentMergeStrategy(ContentMergeStrategy.CONFLICT);
//        cherryPickCommand.setNoCommit(true);
//
//        for (ObjectId id : ids) {
//            System.out.println(id);
//            cherryPickCommand.include(id);
//        }
//        cherryPickCommand.call();
//    }
//}
